package com.yizisu.mvvmlib.baselib.helper

import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater
import android.widget.FrameLayout
import com.yizisu.basemvvm.utils.dip
import com.yizisu.mvvmlib.R
import com.yizisu.mvvmlib.baselib.base.BaseDialog

/**
 * 若红楼梦空，亦初心不变
 * 作者：thinker
 * 包名：com.yizisu.mvvmlib.baselib.helper
 * 时间：2019/6/22 14:53
 * 描述：
 */
class MyDialog : BaseDialog() {
    override fun initViewModel() {

    }

    var gravity: Int = Gravity.CENTER
    override fun getContentResOrView(): Any? = R.layout.my_dialog

    override fun initUi(savedInstanceState: Bundle?) {
    }

    override fun initData() {
    }

    override fun isCanceledOnTouchOutside(): Boolean {
        return true
    }
    override fun onRootViewLayoutParams(lp: FrameLayout.LayoutParams) {
        super.onRootViewLayoutParams(lp)
        lp.gravity = gravity
        lp.width= dip(100)
        lp.height= dip(100)
    }
}